package com.aaa.methodreference.demo04;

import java.util.function.BiPredicate;

/**
 * @author C-Q
 * @version 1.1.0
 * @Description: 对象方法的引用
 *
 * @date 2022/11/4
 */
public class Test01 {
    public static void main(String[] args) {
        //比较两个字符串是否相同，--断言函数式接口
        BiPredicate<String,String> predicate=(t1,t2)->t1.equals(t2);

        //对象方法的引用
        //对象方法的引用    类名::instMethod    (args)->inst.instMethod(args)
        BiPredicate<String,String> predicate1= String::equals;
        //boolean test = predicate1.test("bye", "byes");
        boolean test = predicate1.test("bye", "bye");
        System.out.println("test = " + test);
    }
}
